//
//  NRLSVMAllScreenViewController.m
//  NaRiLSVMT
//
//  Created by zhangmeng on 14-8-25.
//  Copyright (c) 2014年 helloyouth.org. All rights reserved.
//

#import "NRLSVMAllScreenViewController.h"
#import "UIImageView+AFNetworking.h"
#import "Network_Operation.h"
@interface NRLSVMAllScreenViewController ()

@end

@implementation NRLSVMAllScreenViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    UIPanGestureRecognizer *pangesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
    [self.showView addGestureRecognizer:pangesture];
    NSString *strurl = [NSString stringWithFormat:@"%@/%@/%@.png",kBaseUrl,@"player_image",StringFromId
                        (self.arrData[self.clickNum][@"templateId"])];
    NSURL *url = [NSURL URLWithString:strurl];
    [self.imageView setImageWithURL:url];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(IBAction)backBtnclick:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
}
-(void)pan:(UIPanGestureRecognizer *)recognizer
{
    //begin pan...
    // CGFloat initTouchPosX;
    if (recognizer.state == UIGestureRecognizerStateBegan) {
        self.initTouchPosX = [recognizer locationInView:self.showView].x;
    }
    else if (recognizer.state == UIGestureRecognizerStateChanged) { //status change
        CGFloat panAmount = self.initTouchPosX - [recognizer locationInView:self.showView].x;
        // if (self.isExpand) {
        if (panAmount < 0) {
            //右移
            self.direction = EPanDirectionRight;
        }
        else {
            if (panAmount > 0) {
                //左移
                self.direction = EPanDirectionLeft;
            }
        }
    }
    else if (recognizer.state == UIGestureRecognizerStateEnded ||
             recognizer.state == UIGestureRecognizerStateCancelled){
        [self slideOutContentViewInDirection:self.direction];
    }
    
}
#pragma -mark
#pragma -mark Custom Methods
- (void)slideOutContentViewInDirection:(PanDirection)direction {
    // NSArray *tmparr = self.nowPlaydata[self.nowScreen];
   
    switch (direction) {
        case PanDirectionRight:{
            
            
            }
            break;
        case PanDirectionLeft:{
            
          
            }
            break;
        default:
            break;
    }

}

@end
